
<table style="width:800px;margin:auto" border="1">
  <caption>
    DANH SÁCH CATEGORIES
  </caption>
  <tr>
    <th width="58" scope="col">STT</th>
    <th width="219" scope="col">Tên loại</th>
    <th width="101" scope="col">Ẩn/Hiện</th>
    <th width="140" scope="col">Công cụ</th>
  </tr>
<?php
	$sql='select * from `category`';
	$rs=mysqli_query($conn,$sql);
	$stt=1;
	$AnHien=array(0=>'<span style="color:red">Ẩn</span>',1=>'Hiện');
	while($r=mysqli_fetch_assoc($rs))
	{
?>
  <tr>
    <td align="center"><?php echo $stt++?></td>
    <td align="left">&nbsp;<?php echo $r['name']?></td>
    <td align="center">&nbsp;<?php echo $AnHien[$r['show_hide']]?></td>
    <td align="center"><a href="?mod=category_edit&idCategory=<?php echo $r['id'] ?>"><img src="admin/img/b_edit.png" width="16" height="16" alt="Sửa"></a>&nbsp;<a onclick="return confirm('Bạn có chắc chắn muốn xóa hay không ?')" href="?mod=category_delete&idCategory=<?php echo $r['id'] ?>"><img src="admin/img/b_drop.png" width="16" height="16" alt="Xóa"></a></td>
  </tr>
<?php
	}
?>
  <tr>
    <td colspan="6" align="center"><label>
      <input onClick="window.location='?mod=category_add'" type="button" name="category_add" id="category_add" value="Add Category">
    </label></td>
  </tr>
</table>
